
<?php
header("content-type:text/html;charset=utf-8");
$dsn="mysql:host=127.0.0.1;dbname=test;charset=utf8";
$pdo=new PDO($dsn,'root','root');
$id=$_GET['id'];
$sql="select * from class  WHERE id='$id'";
$res=$pdo->query($sql);
$data=$res->fetch(PDO::FETCH_ASSOC);

?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<form action="upd_do.php" method="post">
    <center>
        <h3>修改页面</h3>
        <table border="1">
            <tr>
                <input type="hidden" name="id" value="<?php echo $data['id']?>"/>
                <td>课程名称</td>
                <td><input type="text" name="name" value="<?php echo $data['name']?>"/></td>
            </tr>
            <tr>
                <td>课程时间</td>
                <td><input type="text" name="shijian" value="<?php  echo $data['time']?>" </></td>
            </tr>
            <tr>
                <td>课程数量</td>
                <td><input type="text" name="number" value="<?php echo $data['number']?>" /></td>
            </tr>
            <tr>
                <td>课程教室</td>
                <td><input type="text" name="class" value="<?php echo $data['classname']?>" /></td>
            </tr>
            <tr>
                <td><input type="submit" value="修改"/></td>
            </tr>
        </table>
    </center>
</form>
</body>
</html>


